package com.kindnesslibrary.network.retrofit.invocation;

import java.lang.reflect.Proxy;

/**
 * 动态代理接口，由这个类来产生接口类，实现retrofit
 */
public class MethodProxyFactory {
	
	public static <T> T newInstance(Class<T> methodInterface) {
        final MethodProxy methodProxy = new MethodProxy();
        return (T) Proxy.newProxyInstance(
                Thread.currentThread().getContextClassLoader(), 
                new Class[]{methodInterface}, 
                methodProxy);
    }

}
